# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Karol 'Kenji Takahashi' Woźniak <kenji.sx>
# Contributor: Tianjiao Yin <ytj000+AUR@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: TDY <tdy@gmx.com>
# Contributor: Tiago Pierezan Camargo <tcamargo@gmail.com>

pkgname=python-pyflakes
pkgver=3.0.1
pkgrel=3
pkgdesc='A lint-like tool for Python to identify common errors quickly without executing code'
arch=('any')
url='https://pypi.python.org/pypi/pyflakes'
license=('MIT')
depends=('python')
makedepends=('python-setuptools')
source=("https://pypi.io/packages/source/p/pyflakes/pyflakes-$pkgver.tar.gz")
sha512sums=('10ffe2b92f3885d40578452423a93609f8546b2392997bdbc3f64ca0094516ce6b8449e5d3675bda5fdbc16190c89be23609559fc4cd4f1c97e6af032226d7b7')

build() {
  cd pyflakes-$pkgver
  python setup.py build
}

check() {
  cd pyflakes-$pkgver
  python -m unittest discover pyflakes
}

package() {
  cd pyflakes-$pkgver
  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1

  # We have python 3 as default python, and want to keep compatibility with the old pyflakes3k naming
  ln -s pyflakes "$pkgdir/usr/bin/pyflakes3k"

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
